package cn.big.bigd.biocode.model;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DiscriminatorOptions;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * Created by wangfan on 2017/11/28.
 */
@Entity
@Getter
@Setter
@ToString
@Table(name="vocabularies")
@Inheritance(strategy= InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="type",discriminatorType=DiscriminatorType.STRING)
@DiscriminatorOptions(force = true)
public abstract class Vocabulary {
    @Id
    @GeneratedValue
    private Integer id;
    @Column(nullable = false)
    @NotNull
    @Basic
    private String name;

  /*  @ManyToMany(fetch = FetchType.EAGER)
    @JoinTable(name="tools_vocabularies",
            inverseJoinColumns=
            @JoinColumn(name="tool_id", referencedColumnName="id",foreignKey = @ForeignKey(name="none",value = ConstraintMode.NO_CONSTRAINT)),
            joinColumns=
            @JoinColumn(name="vocabulary_id", referencedColumnName="id",foreignKey = @ForeignKey(name="none",value = ConstraintMode.NO_CONSTRAINT))
    )
    private List<Tool> tools;*/
}
